<?
	include_once('../Admin/include.php');
	include_once('../../MembersOnly/global.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Saturn Valley Shopping Cart</title>
        <style type="text/css">
			<? include_once('../../PageDetails/pagecss.css'); ?>
			div{
				text-align:center;
				background-color:#E8E8E8;
			}
			body{
				margin-left:20%;
				margin-right:20%;
			}
		</style>
    </head>
    
    <body background="../Images/saturnvalley.jpg" bgproperties="fixed" >
    	<div style="margin-top:10px">
            <div class="cart">
            	<a href="http://www2.newpaltz.edu/~N02036842/WSP/Website/Admin/ShoppingCart/cart.php"><span style="margin-top:0px;">Shopping Cart:</span></a>
                 <?=$_SESSION['cartCount'] ?> 
                 <? if($_SESSION['cartCount'] == null) echo("");
				 	elseif($_SESSION['cartCount'] == 1) echo(" Item in your cart.");
				 	else echo(" Items in your cart.");					   
				?> ($<?=$_SESSION['cartPrice']?>)
            </div>
            <div class="signIn">
            	<div>
                	<? include('../../MembersOnly/loginLinkControl.php'); ?>
                </div>
                <div style="float:right">
                	<a href="http://www2.newpaltz.edu/~N02036842/WSP/Website/MembersOnly/register.php">Register</a>
                </div>
            </div>
            <div>
            	<? include('../../PageDetails/pageheader.php'); ?>
            </div>
        	<div>
            	<? if($rs = GetCurrentUser()): ?>
   					<?=$rs['FirstName']?>'s
                <? endif; ?>
        		Shopping Cart:
            </div>
            <div>
            	<hr color="#000000" width="600px" />
            </div>
            <div class="cartCell">
            	<? // for($count=1; $count <= $_SESSION['cartCount'], $count++){?>
                    <div class="itemIdCell" style="float:left">
                        <p class="header">Item Id</p>
                        <?=$_SESSION['Cart']['ItemId'];?>
                    </div>
                    <div class="itemNameCell" style="float:left">
                        <p class="header">Item Name</p>
                        <?=$_SESSION['Cart']['ItemName'];?>
                    </div>
                    <div class="itemQtyCell" style="float:left">
                        <p class="header">Qty</p>
                        <?=$_SESSION['Cart']['Qty'];?>
                    </div>
                    <div class="itemPriceCell" style="float:left">
                        <p class="header">Price</p>
                        <?=$_SESSION['Cart']['Price'];?>
                    </div>
                    <div class="itemPriceTotal">
                        <p class="header">Total Price</p>
                        <? $finalPrice = $_SESSION['Cart']['Price'] * $_SESSION['Cart']['Qty'];
                           if($finalPrice > 0) echo $finalPrice;?>
                    </div>
                    <div style="width:140px; height:30px; float:left;"></div>
                <? //} ?>
            </div>
            <div style="width:768px; float:left">
            	<div style="float:right; margin-right:10%">
            		Total Price: <?=$_SESSION['cartPrice']?>
                </div>
            </div>
            <div>
				<? include('../../PageDetails/pagefooter.php'); ?>
            </div>
        </div>
    </body>
</html>
